﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<List<MensUnoShop.Models.Product>>" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ProductDetail
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div id="main-content" class="hastable">
	<div class="title title-spacing">
		<h2>商品列表</h2>
					
	</div>
        
    <input type="button" value="賣場列表" onclick="location.href='/Admin/Product/MarketList'" />
    <input type="button" value="賣場明細" onclick="location.href='/Admin/Product/Market/<%:ViewData["PDmkguid"] %>'" />

    <%using (Html.BeginForm("../Product/ProductDetail", "Product", FormMethod.Post, new { @class = "shBox", enctype = "multipart/form-data" }))
    {%>
        <%:Html.Hidden("Act", TempData["action"])%>
        <%:Html.Hidden("PDguid", TempData["PDguid"])%>
        <%:Html.Hidden("PDmkguid", ViewData["PDmkguid"])%>
    <table cellspacing="0" style="width:800px;">
        <tr>
			<th style="width:70px">商品標籤</th>
            <td colspan="2">
            <%if ((bool)ViewData["IsAdd"])
              {%>
                  <%:Html.DropDownList("PDtitletagidList", (IEnumerable<SelectListItem>)ViewData["PDtitletagidList"])%>
            <%}
              else
              {%>
                  <%:TempData["PDtitle"]%>
            <%}%>
            </td>
		</tr>  
        <%var pb = TempData["PDpicbig"] as string;
          var ps = TempData["PDpicsmall"] as string;
        %>
        <tr>
			<th>商品大圖</th>
			<td style="width:500px">
                <%if(!string.IsNullOrEmpty(pb)){ %><img id="PDpicbig" src="<%:pb%>"/><%} %>
                <input type="file" id="uppicbig" name="uppicbig"/>
            </td>
		</tr>
        <tr>
			<th>商品小圖</th>
			<td>
                <%if(!string.IsNullOrEmpty(pb)){ %><img id="PDpicsmall" src="<%:ps%>" width="35" height="35"  /><%} %>
                <input type="file" id="uppicsmall" name="uppicsmall" />
            </td>
		</tr>		
        <tr>
			
			<td colspan="3">
            <input type="submit" class="submit" value="<%:TempData["bmsg"] %>" />                   
            </td>
		</tr>
    </table>
    <%} %>


    <table cellspacing="0" style="width:700px;">
    <thead>
		<tr>                    
			<td style="width:100px">商品標籤</td>
			<td style="width:100px">商品大圖</td>
            <td style="width:100px">商品小圖</td>
            <td style="width:100px"></td>            
		</tr>
	</thead>
    <%if (Model != null){%>
        <tbody>
    <%foreach (var item in Model)
    {  %>
        <tr>                   
            <td align="center" style="text-align: center" valign="middle"><%:item.TITLE%></td>
            <td align="center" style="text-align: center" valign="middle"><img src="<%:item.PICBIG%>" /></td>
            <td align="center" style="text-align: center" valign="middle"><img src="<%:item.PICSMALL%>" /></td>
            <td style="width:100px">
                <%using (Html.BeginForm("ProductDetail", "Product", FormMethod.Post, new { @style = "display:inline" }))
                  {%>
                    <%:Html.Hidden("Act", "ChgStatus")%>
                    <%:Html.Hidden("PDguid", item.PDGUID)%>
                    <%:Html.Hidden("PDmkguid", item.PDMKGUID)%>
                    <%if (item.PDSTATUS)
                        { %><input type="submit" name="submit" value="上架中" /><%}else{ %><input type="submit" name="submit" value="下架中" /><%} %>
                <%} %>                
                <%if(false){using (Html.BeginForm("/Admin/Product/ProductDetail", "Product", FormMethod.Post, new { @onsubmit = "return confirm('確定刪除?');", @style = "display:inline" }))
                  {%>                
                    <%:Html.Hidden("Act", "Del")%>
                    <%:Html.Hidden("PDguid", item.PDGUID)%>
                    <%:Html.Hidden("PDmkguid", item.PDMKGUID)%>
                    <input type="submit" name="submit" value="刪除" />
                <%}} %>
                <%using (Html.BeginForm("/ProductDetail", "Product", FormMethod.Post, new { @style = "display:inline", enctype = "multipart/form-data" }))
                  {%>
                    <%:Html.Hidden("Act", "Upt")%>
                    <%:Html.Hidden("PDguid", item.PDGUID)%>
                    <%:Html.Hidden("PDmkguid", item.PDMKGUID)%>
                    <input type="submit" name="submit" value="修改" />
                <%} %>
                <input type="button" onclick="location.href='/Admin/Product/SpecDetail/<%:item.PDGUID %>';" value="規格列表" />
            </td>
        </tr>
    <%} %>
    </tbody>
    <%} %>
    </table>
           
    <br/><br/>　
</div>

</asp:Content>
